/**
 * 
 */
package com.door.erp.sevice.impl;

import java.util.List;
import java.util.Map;
import java.util.Random;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.door.erp.dao.ClientDao;
import com.door.erp.dao.base.GenericDao;
import com.door.erp.model.Client;
import com.door.erp.pager.Pager;
import com.door.erp.sevice.ClientService;
import com.door.erp.sevice.base.GenericServiceImpl;

/**
 * @author xiaolongwei@gmail.com
 *
 * 
 */
@Service(value = "clientService")
public class ClientServiceImpl  extends GenericServiceImpl<Client, Long> implements ClientService {
	@Resource(name="clientDao", type=ClientDao.class)
	private ClientDao clientDao;
	@Override
	public GenericDao<Client, Long> getDao() {
		
		return clientDao;
	}
	@Override
	public String generatePwd(){
		char[] numbers = {1,2,3,4,5,6,7,8,9,0};
		Random r = new Random();
		StringBuffer pwd = new StringBuffer();
		for(int i =0; i<6;i++){
			int y = r.nextInt(10);
			if(y==10){
				y--;
			}
			y = numbers[y];
			pwd.append(y);
		}
		return pwd.toString();
	}
	@Override
	public List<Client> getValidateResultSet(Map<String, Object> param,
			Pager pager) {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public int getValidateResultSetCount(Map<String, Object> param) {
		// TODO Auto-generated method stub
		return 0;
	}
	@Override
	public List<Client> getValidateResultSet(Map<String, Object> param) {
		// TODO Auto-generated method stub
		return null;
	}

}
